#ifndef CONFIGWIDGET_H
#define CONFIGWIDGET_H

#include <QWidget>
#include <QLabel>
#include <QLineEdit>
#include <QVBoxLayout>
#include <QSettings>
#include <QComboBox>

class ConfigWidget : public QWidget
{
    Q_OBJECT

public:
    explicit ConfigWidget(QWidget *parent = nullptr);
    ~ConfigWidget();
    QString getSetting(QString key);

private:
    QVBoxLayout *layout;

    void createConfigItem(const QString &description, const QString &key, QWidget *settingWidget = nullptr);
    void createPythonTestWidget();
    void createRgTestWidget();

    QSettings *settings;
    QMap<QString, QString> defaultKV = {
        {"tss_python_bin_path", "~/.tss/bin/python"},
        {"aider_python_bin_path", "~/.aider/bin/python"},
        {"aider_api_type", "DEEPSEEK_API_KEY"},
        {"aider_api_key", "sk-dd02d6427dd64dd4b5b85dca3fd729a0"}
    };
    // QComboBox *aiderApiTypeBox;
    // QStringList aiderApiTypes = {"DeepSeek", "OpenAI"};

private slots:
    void onValueChanged(const QString &key, const QString &value);
};

#endif // CONFIGWIDGET_H
